from rest_framework.viewsets import ModelViewSet

from books.models import BookInfo, HeroInfo
from books.testDRF.serializer import BookModelSerializer, HeroModelSerializer


class BookViewSet(ModelViewSet):
    queryset = BookInfo.objects.all()
    serializer_class = BookModelSerializer


class HeroViewSet(ModelViewSet):
    queryset = HeroInfo.objects.all()
    serializer_class = HeroModelSerializer